<?php

declare(strict_types=1);
/**
 * This file is part of Hyperf.
 *
 * @link     https://www.hyperf.io
 * @document https://hyperf.wiki
 * @contact  group@hyperf.io
 * @license  https://github.com/hyperf/hyperf/blob/master/LICENSE
 */
use Hyperf\HttpServer\Router\Router;

Router::addRoute(['GET', 'POST', 'HEAD'], '/', function () {
    return 'Hello Hyperf ！';
});

Router::get('/favicon.ico', function () {
    return '';
});

//管理员登录
Router::post('/v1/admin/login', 'App\Controller\Api\v1\AdminController@login');
//管理员退出
Router::post('/v1/admin/logout', 'App\Controller\Api\v1\AdminController@logout');
//管理员模块
Router::addGroup('/v1/admin/',function (){
    //获取菜单列表
    Router::post('adminMenu', 'App\Controller\Api\v1\AdminController@adminMenu');
    //管理员列表
    Router::post('list', 'App\Controller\Api\v1\AdminController@list');
    //管理员新增
    Router::post('create', 'App\Controller\Api\v1\AdminController@create');
    //管理员更新
    Router::post('update', 'App\Controller\Api\v1\AdminController@update');
    //管理员详情
    Router::post('detail', 'App\Controller\Api\v1\AdminController@detail');
    //管理员删除
    Router::post('delete', 'App\Controller\Api\v1\AdminController@delete');
});

//菜单模块
Router::addGroup('/v1/menu/',function (){
    //菜单列表
    Router::post('list', 'App\Controller\Api\v1\MenuController@list');
    //菜单新增
    Router::post('create', 'App\Controller\Api\v1\MenuController@create');
    //菜单更新
    Router::post('update', 'App\Controller\Api\v1\MenuController@update');
    //菜单详情
    Router::post('detail', 'App\Controller\Api\v1\MenuController@detail');
    //菜单删除
    Router::post('delete', 'App\Controller\Api\v1\MenuController@delete');
});


//角色模块
Router::addGroup('/v1/role/',function (){
    //部门列表
    Router::post('list', 'App\Controller\Api\v1\AuthRoleController@list');
    //部门新增
    Router::post('create', 'App\Controller\Api\v1\AuthRoleController@create');
    //部门更新
    Router::post('update', 'App\Controller\Api\v1\AuthRoleController@update');
    //部门详情
    Router::post('detail', 'App\Controller\Api\v1\AuthRoleController@detail');
    //部门删除
    Router::post('delete', 'App\Controller\Api\v1\AuthRoleController@delete');
});


//部门模块
Router::addGroup('/v1/dept/',function (){
    //部门列表
    Router::post('list', 'App\Controller\Api\v1\DepartmentController@list');
    //部门新增
    Router::post('create', 'App\Controller\Api\v1\DepartmentController@create');
    //部门更新
    Router::post('update', 'App\Controller\Api\v1\DepartmentController@update');
    //部门详情
    Router::post('detail', 'App\Controller\Api\v1\DepartmentController@detail');
    //部门删除
    Router::post('delete', 'App\Controller\Api\v1\DepartmentController@delete');
});

//登录日志模块
Router::addGroup('/v1/login_log/',function (){
    //登录日志列表
    Router::post('list', 'App\Controller\Api\v1\AdminLoginLogController@list');
    //登录日志详情
    Router::post('detail', 'App\Controller\Api\v1\AdminLoginLogController@detail');

});

//操作日志模块
Router::addGroup('/v1/operate_log/',function (){
    //操作日志列表
    Router::post('list', 'App\Controller\Api\v1\AdminLogController@list');
    //操作日志详情
    Router::post('detail', 'App\Controller\Api\v1\AdminLogController@detail');
});